#{extends 'magicBox.html' /}

#{set 'title'}${project.name}'s#{/set}
#{if (sprints.size()==0)}
	There are No Sprints.
#{/if}
#{else}
	#{list items:sprints, as:'sprint'}
		#{if (sprint.running()) }
			<div class="greenBg" name="@{Boards.sprintBoards(sprint.id)}">Sprint ${sprint.sprintNumber}#{drop 'sprint-' + sprint.id /}
			#{if sprint.project.hasComponents()>1}
				<a href="#" onclick="overlayOpen('@{Boards.loadboard1(sprint.id)}')" title="View project board?">
				<img src="@{'public/images/famfam/application_view_tile.png'}"/></a>
			#{/if}
			#{else}
				<a href="#" onclick="overlayOpen('@{Boards.loadboard1(sprint.id,sprint.project.components[0].id)}')" title="View project board?">
				<img src="@{'public/images/famfam/application_view_tile.png'}"/></a>
			#{/else}
			#{if connected.in(sprint.project).can("editSprint")}
				<a href="#" onclick="overlayOpen('@{Sprints.projectshow(sprint.id)}')"><img src="/public/images/famfam/pencil.png" /></a>
			#{/if}
			</div>
		#{/if}
		#{else}
			#{if (sprint.ended || sprint.ended()) }
				<div class="redBg" name="@{Boards.sprintBoards(sprint.id)}">Sprint ${sprint.sprintNumber}
					
				#{if connected.in(sprint.project).can("editSprint")}
					<img class="dim"src="/public/images/famfam/pencil.png" />
				#{/if}
				</div>
			#{/if}
		#{else}
			<div class="yellowBg" name="@{Boards.sprintBoards(sprint.id)}">Sprint ${sprint.sprintNumber}#{drop 'sprint-' + sprint.id /}
			#{if connected.in(sprint.project).can("editSprint")}
				<a href="#" onclick="overlayOpen('@{Sprints.projectshow(sprint.id)}')"><img src="/public/images/famfam/pencil.png" /></a>
			#{/if}
			</div>
			#{/else}
		#{/else}
	#{/list}
#{/else}
